import React from 'react'
import { Route, useRouteMatch } from "react-router-dom";
import { Hello } from './Hello'

export const About = (props) => {
  const {path} = useRouteMatch()
  console.log(path)
  return (
    <div>
        <h1>这是关于页</h1>
        {
            props.location.state && 
            <>
                <p>{props.location.state.title}</p>
                <p>{props.location.state.desc}</p>
            </>
        }
        <Route path={`${path}/hello`}>
            <Hello></Hello>
        </Route>
    </div>
  )
}
